package edu.ccut.saturn.studio.validate.common;

import edu.ccut.saturn.studio.core.util.eclipse.Messages;

/**
 * 
 * @author Bai Yucheng  2007-12-12
 *
 */
public class JavaScriptSet {
	public static String[] javaScripts = {
		Messages.getString("JavaScriptSet.length"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.color"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.identity"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.url"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.postcode"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.doubletype"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.legal"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.doublebyte"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.chinese"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.english"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.ip"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.empty"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.int"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.moblilephone"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.number"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.decimal"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.port"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.email"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.money"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.legal1"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.englishandnumber"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.legal2"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.50.telephone"), //$NON-NLS-1$
		Messages.getString("JavaScriptSet.password") //$NON-NLS-1$
	};
	
	public static String zhToEnJs(String str) {
		if (str.equals(Messages.getString("JavaScriptSet.length"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.limitlen"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.color1"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.iscolor"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.identitycard"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.iscard"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.url"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isurl"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.zip"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.iszip"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.double"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isdouble"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.illegal"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.hasaccountchar"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.doubletype1"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isdoublechar"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.chinese"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.ischinese"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.english"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isenglish"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.ip"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isip"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.empty"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isnull"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.int"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isinteger"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.mobilepnone"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.checkmobile"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.number"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isnumber"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.decimal"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isdecimal"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.port"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isport"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.email"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isemail"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.money"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.ismoney");  //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.illegal2"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isnumberorletter"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.englishornumber"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isnumberorletter1"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.chineseorletterornumber"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.isChinaOrNumbOrLett"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.telephone"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.checkPhone"); //$NON-NLS-1$
		}
		if (str.equals(Messages.getString("JavaScriptSet.password"))) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.checkPwd"); //$NON-NLS-1$
		}
		return str;
	}
	
	public static String enToZhJs(String str) {
		if (str.equals("limitLen")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.length"); //$NON-NLS-1$
		}
		if (str.equals("isColor")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.color"); //$NON-NLS-1$
		}
		if (str.equals("isCard")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.identitycard"); //$NON-NLS-1$
		}
		if (str.equals("isURL")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.url"); //$NON-NLS-1$
		}
		if (str.equals("isZip")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.zip"); //$NON-NLS-1$
		}
		if (str.equals("isDouble")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.doubletype"); //$NON-NLS-1$
		}
		if (str.equals("hasAccountChar")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.illegal3"); //$NON-NLS-1$
		}
		if (str.equals("isDoubleChar")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.doubletype1"); //$NON-NLS-1$
		}
		if (str.equals("isChinese")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.chinese"); //$NON-NLS-1$
		}
		if (str.equals("isEnglish")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.english"); //$NON-NLS-1$
		}
		if (str.equals("isIP")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.ip"); //$NON-NLS-1$
		}
		if (str.equals("isNull")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.null"); //$NON-NLS-1$
		}
		if (str.equals("isInteger")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.int"); //$NON-NLS-1$
		}
		if (str.equals("checkMobile")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.mobilephone"); //$NON-NLS-1$
		}
		if (str.equals("isNumber")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.number"); //$NON-NLS-1$
		}
		if (str.equals("isDecimal")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.decimal"); //$NON-NLS-1$
		}
		if (str.equals("isPort")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.port"); //$NON-NLS-1$
		}
		if (str.equals("isEmail")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.email"); //$NON-NLS-1$
		}
		if (str.equals("isMoney")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.money"); //$NON-NLS-1$
		}
		if (str.equals("isNumberOr_Letter")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.illegal4"); //$NON-NLS-1$
		}
		if (str.equals("isNumberOrLetter")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.englishornumber"); //$NON-NLS-1$
		}
		if (str.equals("isChinaOrNumbOrLett")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.chineseorletterornumber"); //$NON-NLS-1$
		}
		if (str.equals("checkPhone")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.telephone"); //$NON-NLS-1$
		}
		if (str.equals("checkPwd")) { //$NON-NLS-1$
			return Messages.getString("JavaScriptSet.password"); //$NON-NLS-1$
		}
		return str;
	}
		
}
